-- Viral Resistance - T-Engine 4 Module
-- Copyright (C) 2010 Mikolai Fajer
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program.  If not, see <http://www.gnu.org/licenses/>.
--
-- Mikolai Fajer "yufra"
-- mfajer@gmail.com

newTalentType{ type="viral/control", name = "viral control", description = "Viral control", generic = true }

newTalent{
	name = "Viral Resistance",
	type = {"viral/control", 1},
	mode = "passive",
	points = 5,
	on_learn = function(self, t)
		self.vload_regen = self.vload_regen - 0.1
	end,
	on_unlearn = function(self, t)
		self.vload_regen = self.vload_regen + 0.1
	end,
	info = function(self, t)
		return ([[Your natural resistance reduces your viral load (+%0.2f vload/turn).]]):format(self:getTalentLevelRaw(t) / 50)
	end,
}

newTalent{
    name = "Viral Mimic",
    type = {"viral/control", 2},
    mode = "activated",
    points = 5,
    viral = 5,
    viral_req = 25,
    cooldown = 10,
    action = function(self, t)
        self:setEffect(self.EFF_MIMIC, 1 + self:getTalentLevel(t), {})
        return true
    end,
    info = function(self, t)
        return([[Your understanding of the virus allows you to mimic the zombie behavior, temporarily stopping hostilities.  The mimic will last %d turns.]]):format(1 + self:getTalentLevel(t))
    end,
}